package com.mdc.controller;

import com.mdc.model.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 * @author Mordecai
 * @version 1.0.0
 * @blog https://gitee.com/mordeky/SpringBoot
 *
 */
@RestController
@RequestMapping("/rest-controller") // 根路径
public class HelloRestController {
    // http://localhost:8080/rest/controller/hello
    @RequestMapping("/hello")
    public String getStr(){ return "Hello, World!"; }

    // http://localhost:8080/controller/user
    @RequestMapping("/user")
    public User getUser(){ return new User((long) 1995, "Tom", 15); }
}